//
//  AccountCollectionViewCell.m
//  MarryMe
//
//  Created by lanou3g on 16/1/14.
//  Copyright © 2016年 revocher. All rights reserved.
//

#import "AccountCollectionViewCell.h"
#import "Mothy.h"
@implementation AccountCollectionViewCell

- (void)awakeFromNib {
    UITapGestureRecognizer *liftTapGR=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(liftTapGRAction:)];
    self.editButton.hidden=YES;
    self.deleteButton.hidden=YES;
    self.userImageView.userInteractionEnabled=YES;
    [self.userImageView addGestureRecognizer:liftTapGR];
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(buttonAction:) name:@"name" object:nil];
    
}

-(void)buttonAction:(NSNotification*)sender{
    self.editButton.hidden=YES;
    self.deleteButton.hidden=YES;
}

-(void)liftTapGRAction:(UITapGestureRecognizer*)sender{
        if (self.editButton.hidden==YES) {
            self.editButton.hidden=NO;
            self.deleteButton.hidden=NO;
        }else{
            self.editButton.hidden=YES;
            self.deleteButton.hidden=YES;
        }
}

-(void)setCellmodel:(Mothy *)model{
    self.userImageView.image=[UIImage imageNamed:model.picture];
  NSMutableString *str= [[NSMutableString alloc] initWithString:@"支出 "];
    [str appendString:model.name];
    [str appendString:@" "];
    [str appendString:model.closed];
    self.textLable.text=str;
}
@end
